<template>
    <div>
        <div class="space"></div>
        <div class="title">
          <img class="icon-img" src="https://imgs.qunarzz.com/piao/fusion/1711/89/ebc329f16c55bb02.png"/>
          猜你喜欢
        </div>
        <ul>
          <router-link
            tag="li"
            :to="'/detail/' + item.id"
            class="item border-bottom"
            v-for="item of list"
            :key="item.id">
                <img class="item-img" :src='item.imgUrl'/>
                <div class="item-info">
                    <p class="item-title">{{item.title}}</p>
                    <button class="item-button">查看详情</button>
                    <p class="item-desc">{{item.desc}}</p>
                </div>
            </router-link>
        </ul>
    </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    list: Array
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .space
    height: .2rem
    background: #eee
  .title
    line-height: .8rem
    text-indent: .2rem
    .icon-img
      width: .3rem
      height: .3rem
      margin-left: .2rem
  .item
    overflow: hidden
    display: flex
    height: 1.9rem
    .item-img
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      flex: 1
      padding: .1rem
      min-width: 0
      .item-title
        line-height: .54rem
        font-size: .32rem
        ellipsis()
      .item-desc
        margin-top: .2rem
        margin-right: .24rem
        padding: .04rem .1rem
        line-height: .34rem
        font-size: .24rem
        color: #f55
        ellipsis()
      .item-button
        line-height: .24rem
        margin-top: .1rem
        background: #ff9300
        padding: 0.12rem
        border-radius: .06rem
</style>
